package org.come.Jpanel;

import com.tool.btn.LiangHaoPaiBtn;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;
import org.come.Frame.ZhuFrame;
import org.come.bean.SearchSellXianYuResultBean;
import org.come.until.FormsManagement;
import org.come.until.SrcollPanelUI;
import org.come.until.Util;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import java.awt.*;
import java.awt.event.*;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Vector;

public class GetLiangHaoThreeJpanel extends JPanel {

    private static final long serialVersionUID = 1L;
    private Map<String, String> xjDate;


    private JLabel title;
    private JLabel xjDateStr;
	private LiangHaoPaiBtn xjBtn;//信笺

    private JLabel xjBtnLabel;
    // 滚动条
    ImageIcon bg1;
    public GetLiangHaoThreeJpanel() {
        this.setPreferredSize(new Dimension(697, 538));
        this.setLayout(null);
        this.setOpaque(false);
        this.bg1 = new ImageIcon("inkImg/newbackground/132.png");
        title = new JLabel();
        title.setBounds(110, 80, 120, 15);
        title.setForeground(Color.black);
        title.setFont(new Font("宋体", 0, 16));
        title.setText("投放时间为：");
        this.add(title);

        xjDateStr = new JLabel();
        xjDateStr.setBounds(230, 80, 400, 15);
        xjDateStr.setForeground(Color.RED);
        xjDateStr.setFont(new Font("宋体", 0, 16));
        xjDateStr.setText("");
        this.add(xjDateStr);

		xjBtn = new LiangHaoPaiBtn("inkImg/newbutton/187.png", 1, UIUtils.COLOR_WHITE, UIUtils.TEXT_HY16, "购买", 3, null);
		this.xjBtn.setBounds(325, 440, 67, 35);
		this.add(this.xjBtn);

        xjBtnLabel = new JLabel();
        xjBtnLabel.setBounds(48, 70, 625, 426);
        xjBtnLabel.setIcon(this.bg1);
//        xjBtnLabel.addMouseListener(new MouseListener() {
//            @Override
//            public void mouseClicked(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mousePressed(MouseEvent e) {
//                FormsManagement.showForm(704);
//            }
//
//            @Override
//            public void mouseReleased(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mouseEntered(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mouseExited(MouseEvent e) {
//
//            }
//        });
        this.add(xjBtnLabel);
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        //g.drawImage(this.bg1.getImage(), 150, 150, 200, 200, null);

        if (xjDate != null) {
            this.xjDateStr.setText(xjDate.get("start") + " 00:00:00 ~ " + xjDate.get("end") + " 00:00:00");
        }
        //} else {

        //}
    }

    public void changeFrom(int caozuo) {
        // 向服务器请求寄售点卡列表数据
    }

    public Map<String, String> getXjDate() {
        return xjDate;
    }

    public void setXjDate(Map<String, String> xjDate) {
        this.xjDate = xjDate;
    }
}
